import { BASEURL, Post } from './api.js';
//var api = require("./api.js").default;

const url = {
    getLoginUserInfo: BASEURL + "/api/getLoginUserInfo",    //获得本人用户信息
    getXsArr: BASEURL + "/api/getXsArr",                    //获得本人所属机构的销售 人员数组
    getXsAndShqArr: BASEURL + "/api/getXsAndShqArr",        //获得本人所属机构的销售 和 售前 人员数组
}

export const getLoginUserInfo = (params={}) => {
    return new Promise((resolve, reject) => {
        Post(url.getLoginUserInfo, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const getXsArr = (params={}) => {
    return new Promise((resolve, reject) => {
        Post(url.getXsArr, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export const getXsAndShqArr = (params={}) => {
    return new Promise((resolve, reject) => {
        Post(url.getXsAndShqArr, params).then((res) => {
            resolve(res);
        }).catch((res) => {
            reject(res);
        });
    });
}

export default {
    getLoginUserInfo,getXsArr,getXsAndShqArr
}